package com.imooc.o2o.web.shopadmin;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.imooc.o2o.entity.Shop;

@Controller
@RequestMapping(value="/shopadmin", method= {RequestMethod.GET})
public class ShopAdminController {

	@RequestMapping("/shopoperation")
	public String shopOperation() {
		return "shop/shopoperation";
	}
	
	@RequestMapping("/shoplist")
	public String shopList() {
		return "shop/shoplist";
	}
	
	@RequestMapping("/shopmanagement")
	public String shopManagement(HttpServletRequest request, Long shopId) {
		Shop shop = new Shop();
		shop.setShopId(shopId);
		request.getSession().setAttribute("currentShop", shop);
		return "shop/shopmanagement";
	}
	
	@RequestMapping("/productcategorymanagement")
	public String productCategoryManage() {
		return "shop/productcategorymanagement";
	}
	
	@RequestMapping("/productoperation")
	public String productOperation() {
		return "shop/productoperation";
	}
	
	@RequestMapping("/productmanagement")
	public String productManagement() {
		return "shop/productmanagement";
	}
}
